﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace WarehouseManagement.BusinessLogic.DTO
{
    public partial class PODTO : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _Id;

        private string _PONumber;

        private System.DateTime _PODate;

        private int _SupplierId;

        private int _CurrencyId;

        private decimal _ExchangeRate;

        private decimal _Paid;

        private string _Notes;

        private string _CreatedBy;

        private System.DateTime _CreatedDate;

        

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(System.Guid value);
        partial void OnIdChanged();
        partial void OnPONumberChanging(string value);
        partial void OnPONumberChanged();
        partial void OnPODateChanging(System.DateTime value);
        partial void OnPODateChanged();
        partial void OnSupplierIdChanging(int value);
        partial void OnSupplierIdChanged();
        partial void OnCurrencyIdChanging(int value);
        partial void OnCurrencyIdChanged();
        partial void OnExchangeRateChanging(decimal value);
        partial void OnExchangeRateChanged();
        partial void OnPaidChanging(decimal value);
        partial void OnPaidChanged();
        partial void OnNotesChanging(string value);
        partial void OnNotesChanged();
        partial void OnCreatedByChanging(string value);
        partial void OnCreatedByChanged();
        partial void OnCreatedDateChanging(System.DateTime value);
        partial void OnCreatedDateChanged();
        #endregion

        public PODTO()
        {
           
            OnCreated();
        }

        public System.Guid Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        public string PONumber
        {
            get
            {
                return this._PONumber;
            }
            set
            {
                if ((this._PONumber != value))
                {
                    this.OnPONumberChanging(value);
                    this.SendPropertyChanging();
                    this._PONumber = value;
                    this.SendPropertyChanged("PONumber");
                    this.OnPONumberChanged();
                }
            }
        }

        public System.DateTime PODate
        {
            get
            {
                return this._PODate;
            }
            set
            {
                if ((this._PODate != value))
                {
                    this.OnPODateChanging(value);
                    this.SendPropertyChanging();
                    this._PODate = value;
                    this.SendPropertyChanged("PODate");
                    this.OnPODateChanged();
                }
            }
        }

        public int SupplierId
        {
            get
            {
                return this._SupplierId;
            }
            set
            {
                if ((this._SupplierId != value))
                {
                   
                    this.OnSupplierIdChanging(value);
                    this.SendPropertyChanging();
                    this._SupplierId = value;
                    this.SendPropertyChanged("SupplierId");
                    this.OnSupplierIdChanged();
                }
            }
        }

        public int CurrencyId
        {
            get
            {
                return this._CurrencyId;
            }
            set
            {
                if ((this._CurrencyId != value))
                {
                   
                    this.OnCurrencyIdChanging(value);
                    this.SendPropertyChanging();
                    this._CurrencyId = value;
                    this.SendPropertyChanged("CurrencyId");
                    this.OnCurrencyIdChanged();
                }
            }
        }

        public decimal ExchangeRate
        {
            get
            {
                return this._ExchangeRate;
            }
            set
            {
                if ((this._ExchangeRate != value))
                {
                    this.OnExchangeRateChanging(value);
                    this.SendPropertyChanging();
                    this._ExchangeRate = value;
                    this.SendPropertyChanged("ExchangeRate");
                    this.OnExchangeRateChanged();
                }
            }
        }

        public decimal Paid
        {
            get
            {
                return this._Paid;
            }
            set
            {
                if ((this._Paid != value))
                {
                    this.OnPaidChanging(value);
                    this.SendPropertyChanging();
                    this._Paid = value;
                    this.SendPropertyChanged("Paid");
                    this.OnPaidChanged();
                }
            }
        }

        public string Notes
        {
            get
            {
                return this._Notes;
            }
            set
            {
                if ((this._Notes != value))
                {
                    this.OnNotesChanging(value);
                    this.SendPropertyChanging();
                    this._Notes = value;
                    this.SendPropertyChanged("Notes");
                    this.OnNotesChanged();
                }
            }
        }

        public string CreatedBy
        {
            get
            {
                return this._CreatedBy;
            }
            set
            {
                if ((this._CreatedBy != value))
                {
                   
                    this.OnCreatedByChanging(value);
                    this.SendPropertyChanging();
                    this._CreatedBy = value;
                    this.SendPropertyChanged("CreatedBy");
                    this.OnCreatedByChanged();
                }
            }
        }

        public System.DateTime CreatedDate
        {
            get
            {
                return this._CreatedDate;
            }
            set
            {
                if ((this._CreatedDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.SendPropertyChanging();
                    this._CreatedDate = value;
                    this.SendPropertyChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }

        public string SupplierName { get; set; }
        public string CurrencyName { get; set; }
        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

       
    }
}
